class Solution(object):
    def rob(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        DP1 = [nums[0], 0]
        DP2 = [0, 0]
        for i in range(1, len(nums)):
            DP1[i % 2] = DP2[(i + 1) % 2] + nums[i]
            DP2[i % 2] = max(DP1[(i + 1) % 2], DP2[(i + 1) % 2])
        return max(DP1[(len(nums) + 1) % 2], DP2[(len(nums) + 1) % 2])


data = Solution()
nums = [6,3,10,8,2,10,3,5,10,5,3]
print(data.rob(nums))
